package com.joe.entity.Po;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by joe on 2018/12/27
 * <p>
 * method返回值\参数的 类型实体类
 */
public class ParamType {
    private static final Logger logger = LoggerFactory.getLogger(ParamType.class);

    private Class<?> collectionType;

    private Class<?> objType;

    public ParamType(Class<?> collectionType, Class<?> objType) {
        this.collectionType = collectionType;
        this.objType = objType;
    }

    public Class<?> getCollectionType() {
        return collectionType;
    }

    public void setCollectionType(String typeName) {
        try {
            this.collectionType = Class.forName(typeName);
        } catch (ClassNotFoundException e) {
            logger.error(e.getMessage(), e);
        }
    }

    public void setCollectionType(Class<?> collectionType) {
        this.collectionType = collectionType;
    }

    public Class<?> getObjType() {
        return objType;
    }

    public void setObjType(Class<?> objType) {
        this.objType = objType;
    }

    public boolean isCollection() {
        return collectionType != null;
    }

}
